package com.naiterui.ehp.bs.patient.bo.notice;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

import com.naiterui.ehp.bs.patient.config.TemplateProperties;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;

/**
 * 患者消息发送需付费模板
 *
 * @author gaoliangliang
 * @date 2019-07-12 15:44
 * @since 1.0.0
 */
@Data
@Builder
@AllArgsConstructor
public class UnPaidMsg extends BaseNotice {

    private static final long serialVersionUID = -845444713844373783L;

    /**
     * 医生姓名
     */
    private String doctorName;
    /**
     * 咨询价格
     */
    private String consultPrice;

    @Override
    public String getTemplateLabel() {
        return "UNPAID";
    }

    @Override
    public void handleContent(List<TemplateProperties.Content> contentList) {
        Map<String, String> formatMap = new HashMap<>();
        formatMap.put("DOCTOR_NAME", this.doctorName);
        formatMap.put("CONSULT_PRICE", this.consultPrice);
        super.formatData(contentList, formatMap);
    }

    @Override
    public boolean validate() {
        return super.validate() && StringUtils.isNoneBlank(doctorName, consultPrice);
    }

}
